<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./css/style.css">
</head>

<body>
    <div id="app">
        <div class="main">
                <div class="left">
                    <ul>
                        <li>
                            <h2>
                                推荐
                            </h2>
                        </li>
                        <li>
                            <span></span>
                            <a href="#" data-type="-1" data-area="-1" id="aa" 
                            @click="singer()">
                                入驻歌手
                            </a>
                        </li>
                    </ul>
                    <ul>
                        <li>
                            <h2>华语</h2>
                        </li>
                        <li>
                            <span></span>
                            <a href="#" data-type="1" data-area="7" id="aa"  @click="singer()">
                                华语男歌手
                            </a>
                        </li>
                        <li>
                            <span></span>
                            <a href="#" data-type="2" data-area="7" id="aa"  @click="singer()">华语女歌手</a>
                        </li>
                        <li>
                            <span></span>
                            <a href="#"data-type="3" data-area="7" id="aa"  @click="singer()">话语组合/乐队</a>
                        </li>
                    </ul>
                    <ul>
                        <li>
                            <h2>欧美</h2>
                        </li>
                        <li>
                            <span></span>
                            <a href="#" data-type="1" data-area="96" id="aa"  @click="singer()">欧美女歌手</a>
                        </li>
                        <li>
                            <span></span>
                            <a href="#" data-type="2" data-area="96" id="aa"  @click="singer()">欧美男歌手</a>
                        </li>
                        <li>
                            <span></span>
                            <a href="#" data-type="3" data-area="96" id="aa"  @click="singer()">欧美组合/乐队</a>
                        </li>
                    </ul>
                    <ul>
                        <li>
                            <h2>亚洲</h2>
                        </li>
                        <li>
                            <span></span>
                            <a href="#" data-type="1" data-area="8" id="aa"  @click="singer()">亚洲男歌手</a>
                        </li>
                        <li>
                            <span></span>
                            <a href="#" data-type="2" data-area="8" id="aa"  @click="singer()">亚洲女歌手</a>
                        </li>
                        <li>
                            <span></span>
                            <a href="#" data-type="3" data-area="8" id="aa"  @click="singer()">亚洲组合/乐队</a>
                        </li>
                    </ul>
                    <ul>
                        <li>
                            <h2>
                                其他
                            </h2>
                        </li>
                        <li>
                            <span></span>
                            <a href="#" data-type="1" data-area="0" id="aa"  @click="singer()">其他男歌手</a>
                        </li>
                        <li>
                            <span></span>
                            <a href="#" data-type="2" data-area="0" id="aa"  @click="singer()">其他女歌手</a>
                        </li>
                        <li>
                            <span></span>
                            <a href="#" data-type="3" data-area="0" id="aa"  @click="singer()">
                                其他组合/乐队
                            </a>
                        </li>
                    </ul>
                </div>
            <div class="right">
                <div class="nav">
                    <h2>入驻歌手</h2>
                    <p>更多></p>
                </div>
                <div class="header">
                    <ul>
                        <li v-for="(item, index) in abcd" :key="index" :class="{active:index===current}"  @click="btn(item.initial,index)" >
                           {{item.title}}
                        </li>
                    </ul>
                </div>
            </div>
            <root-box :qwewqe="qwewqe" id="app1">
                <ul id="uul">
                    <li v-for="(item,index) in qwewqe">
                        <img v-lazy="item.img1v1Url" alt="">
                        <p>{{item.name}}</p>
                    </li>
                </ul>
            </root-box>
        </div>
    </div>
    <script src="../libs/vue.min.js"></script>
    <script src="./js/abcd.js"></script>
    <script src="../libs/axios.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue-lazyload/1.3.3/vue-lazyload.js"></script>
    <script>
        Vue.component("root-box", {
            template: '#app1',
            props: ['qwewqe']
        });
        Vue.use(VueLazyload, {
            preLoad: 1,
            error: './img/loading.gif',
            loading: './img/loading.gif',
            attempt: 1,
        });
        let app = new Vue({
            el: '#app',
            data: {
                starType: "-1",
                abcd: option,
                page: 0,
                result: "",
                title: "入驻歌手",
                flag: false,
                qwewqe: [],
                current:0,
            },
            created() {
                this.getList();
            },
            methods: {
                getList() {
                    axios({
                        method: "get",
                        url: `https://autumnfish.cn/artist/list`
                    }).then(res => {
                        this.qwewqe = res.data.artists;
                    })
                },
                getRight() {
                    axios({
                        method: "get",
                        url: `https://autumnfish.cn/artist/list?initial=${this.initial}`
                    }).then(res => {
                        this.qwewqe = res.data.artists;
                    })
                },
                getCenter() {
                    axios({
                        method: "get",
                        url: `https://autumnfish.cn/artist/list?type=${this.type}&area=${this.area}`
                    }).then(res => {
                        this.qwewqe = res.data.artists;
                    })
                },
                btn(initial,index){
                    this.current=index;
                    this.initial = initial;
                    this.getRight();
                },
                singer(){
                this.type = event.target.dataset.type
                this.area = event.target.dataset.area
                this.getCenter();
                }
            },
        })
    </script>

</html>